<template>
  <!-- 额外费用 -->
  <el-dialog
  v-if="details"
    v-model="dialogVisible"
    :title="getStatusLabel(expenseType, details.type)"
    width="40%"
    :before-close="handleClose"
  >
    <el-form :model="{}" label-width="auto">
      <el-row :gutter="24" v-if="details">
        <el-col :span="12">
          <el-form-item label="费用说明：">
            <span> {{ details.details }} </span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="费用金额：">
            <span> {{ filters.thousands(details.amount) }}元</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="流水号：">
            <span> {{ details.innerId }} </span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="费用备注：">
            <span>{{ details.remarks }}</span>
          </el-form-item>
        </el-col>
        <!-- <el-col :span="12">
          <el-form-item label="外部流水号：">
            <span>{{ details.externalSerialNb }}</span>
          </el-form-item>
        </el-col> -->
        <el-col :span="12">
          <el-form-item label="支付方式：">
            <span>{{
              getStatusLabel(paymentMethodType, details.payMode) ||
              "未支付"
            }}</span>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </el-dialog>
</template>
<script setup>
import { ref, getCurrentInstance } from "vue";
import { ElMessage } from "element-plus";
import {
  expenseType,
  paymentMethodType,
  getStatusLabel,
} from "@/utils/status.js";
const { proxy } = getCurrentInstance();
const dialogVisible = ref(false);
const loading = ref(false);
const details = ref({});
const handleOpen = async (item) => {
  loading.value = true;
  dialogVisible.value = true;
  try {
    console.log(item);
    details.value = item;
    loading.value = false;
  } catch (error) {
    loading.value = false;
  }
};
const handleClose = () => {
  dialogVisible.value = false;
};
defineExpose({
  handleOpen,
});
</script>

